//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include "uSWebHelp.h"
#include "CVerifBase.h"

USERES("WebHelp.res");
USEFORM("uSWebHelp.cpp", uGestionAdresse);
USEFORM("dm_WebHelp.cpp", dmWebHelp); /* TDataModule: File Type */
USEUNIT("CVerifBase.cpp");
USEUNIT("CLogiciel.cpp");
USEFORM("vSAjoutLogiciel.cpp", AjoutLogiciel);
USEUNIT("CVersion.cpp");
USEFORM("vParamVersion.cpp", vAVersion);
USEFORM("vSAjoutVersion.cpp", AjoutVersion);
USEFORM("vSCopyVersion.cpp", CopyVersion);
USEFORM("vSAjoutAdresse.cpp", AjoutAdresse);
USEUNIT("CReference.cpp");
USEFORM("vSDesignationManquante.cpp", RefMultiple);
USERES("Commun.res");
USEFORM("vSModifierAdresse.cpp", vAModifierAdresse);
USEFORM("vParamLogiciel.cpp", vAParamLogiciel);
USEFORM("vSCopyLogiciel.cpp", CopyLogiciel);
USEFORM("vSSupprAdresse.cpp", SupprimerAdresse);
USEFORM("vSCopyRef.cpp", CopyRef);
USEFORM("vSImporter.cpp", fImport);
USEFORM("vAPatienter.cpp", fPatienter);
USEFORM("vADoublonRef.cpp", ListerDoublon);
USEFORM("vASupprimer.cpp", Supprimer);
USEUNIT("CComboAttente.cpp");
USEFORM("vAMsgErreur.cpp", MsgErreur);
USELIB("C:\Program Files\Borland\CBuilder5\Lib\wininet.lib");
USEUNIT("CVerifInternet.cpp");
USEFORM("vCSupprLogMenu.cpp", vSSupprLogMenu);
USEFORM("vSSupprVerMenu.cpp", SupprVerMenu);
USEUNIT("CKeyWebHelp.cpp");
USEUNIT("CHistorique.cpp");
USEFORM("vLHistorique.cpp", Histo);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
    CVerifBase * Existence = NULL;
    try {
        HINSTANCE hMutex = CreateMutex(NULL,true,"WebHelp" );
        if (GetLastError() == ERROR_ALREADY_EXISTS){
            ShowMessage("Le logiciel WebHelp est déjà lancé");
            Application->Terminate();
        }else {
            ReleaseMutex(hMutex);
            Existence = new CVerifBase();
            if(Existence->VerifierTables()) {
                Application->Initialize();
                Application->CreateForm(__classid(TuGestionAdresse), &uGestionAdresse);
         Application->Run();
            }else
              ShowMessage("Veuillez relancer votre application");
        }
    }catch (Exception &exception) {
         Application->ShowException(&exception);
         Existence = NULL;
    }
    if(Existence) {delete Existence; Existence = NULL;}
    return 0;
}
//---------------------------------------------------------------------------
